package net.xdclass.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 姜阿木
 * @date 2025/7/22 15:11
 */
@Getter
@AllArgsConstructor
public enum ShareDayTypeEnum {

    PERMANENT(0,0),

    SEVEN_DAYS(1,7),

    THIRTY_DAYS(2,30);

    private Integer dayType;

    private Integer days;

    /**
     * 根据类型获取枚举天数
     * @param dayType
     * @return
     */
    public static Integer getDayByType(Integer dayType){
        for (ShareDayTypeEnum value : ShareDayTypeEnum.values()) {
            if(value.getDayType().equals(dayType)){
                return value.getDays();
            }
        }
        return SEVEN_DAYS.days;
    }
}
